package spring.cloud.tasks.api.analyzer;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import spring.cloud.tasks.api.domain.zooKeeperClusterAndNameSpace.NameSpaceConfiguration;
import spring.cloud.tasks.common.zookeeper.ZooKeeper;

/**
 * 关键点
 * task_type 批次
 * 分片数(定义的不重要  实时的重要。)
 * 任务权重+执行器权重+执行器不高可用
 * <p>
 * 实时刻刻的执行情况 任务执行过程中的超时未跑  完成 失败及失败的原因 超时。
 */
@Slf4j
@Setter
@Getter
public class StatisticsAnalyzerModel {


    private TaskStatisticsAnalyzer taskStatisticsAnalyzer;
    private ExecutorInfoAnalyzer executorInfoAnalyzer;


    public TaskStatistics analyzeTaskStatistics(NameSpaceConfiguration nameSpaceConfiguration, ZooKeeper zooKeeper, String job) throws Exception {
        return taskStatisticsAnalyzer.analyzeTaskStatistics(zooKeeper, nameSpaceConfiguration, job, executorInfoAnalyzer);
    }

    public void analyzeExecutor(ZooKeeper zooKeeper, NameSpaceConfiguration nameSpaceConfiguration) {
        executorInfoAnalyzer.analyzeExecutor(zooKeeper, nameSpaceConfiguration);
    }


}
